/* Structure for a foundation pile */
typedef struct {
    int baserank;	/* Rank of card that can be moved in when empty */
    int basesuit;	/* Suit of card that can be moved in when empty */
    int buildstep;	/* Rank step when building on non-empty */
    int maxsize;	/* Maximum number of cards that can be inserted */
    int id;		/* ID number of stack with current contents */
} FoundStack;

extern FoundStack *foundation;

extern int (*superfound)(Stack *s, int index1, int len);
int sf_acebase(Stack *s, int index1, int len);
int sf_kingdown(Stack *s, int index1, int len);
int sf_constbase(Stack *s, int index1, int len);
int sf_complete(Stack *s, int index1, int len);

void makeFound(int baserank, int basesuit, int buildstep, int maxsize);
void printFound(FILE *f, Stack *stks);
int nOff(void);
void cleanFound(void);
void gatherFound(Stack *s);
int found_mayInsert(Stack *dst, Card *card, int len, Stack *src);
